import ajax from "./ajax"
import { PURSE_LIST, DICT_INFO_URL,FILE_UPLOAD_URL,PURSE_ADD,PURSE_EDIT } from '../config/urls.conf'
export function purchaseList(query) {
    return ajax({
        url: PURSE_LIST,
        method: 'GET',
        params: query
    })
}
// 字典
export function getDictListApi(type) {
    return ajax({
        url: DICT_INFO_URL,
        params: {
            page: 1,
            size: 100,
            type
        },
    })
}
//图片地址
export function fileUploadApi(dir, file) {
    return ajax({
        url: FILE_UPLOAD_URL + dir,
        method: 'POST',
        data: file
    })
}
//采购新增
export function getPurchaseAdd(data){
    return ajax({
        url:PURSE_ADD,
        method:'PUT',
        data
    })
}
//采购编辑
export function getPurchaseEdit(data){
    return ajax({
        url:PURSE_EDIT,
        method:'POST',
        data
    })
}